<template>
  <div>
    <h1 v-bgred>Hello 自定义指令</h1>

    <p v-bgred v-bold>我是p标签,你看我有没有加粗</p>
  </div>
</template>

<script>
export default {
  name: "App",
  directives: {
    bgred(ele) {
      ele.style.background = "red";
    },
  },
};
</script>

<style>
</style>